<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mtg_game_faq_data', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('mtg-游戏faq');

            $table->increments('id');
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);
            $table->integer('game_id')->comment('游戏id')->unsigned()->default(0);
            $table->integer('type_id')->comment('类型id')->unsigned()->default(0);
            $table->string('title', 125)->comment('标题')->default('');
            $table->string('desc', 2048)->comment('详情')->default('');
            $table->integer('hot_index')->comment('热度排名')->unsigned()->default(0);
            $table->integer('hot_value')->comment('热度值')->unsigned()->default(0);

            $table->index('game_id');
            $table->index('title');
            $table->index('hot_index');
            $table->index('hot_value');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mtg_game_faq_data');
    }
};
